package algorithm.acwing.t799;

import java.io.*;

public class Main {
    static class io {
        // 读
        static InputStreamReader ins = new InputStreamReader(System.in);
        static StreamTokenizer in = new StreamTokenizer(ins);
        static BufferedReader br = new BufferedReader(ins);

        // 写
        public static PrintWriter out = new PrintWriter(System.out);


        public static int readInt() {
            try {
                in.nextToken();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }

        public static String readLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public static double readDouble() {
            try {
                in.nextToken();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return in.nval;
        }
    }

    public static void main(String[] args) {
        int n = io.readInt(), m = io.readInt();
        int[] a = new int[n+2];
        int[] b = new int[n+2];
        for(int i = 1; i <= n; i++) {
            a[i] = io.readInt();
            b[i] = a[i] - a[i-1];
        }
        while (m-- > 0) {
            int l = io.readInt(), r = io.readInt(), c = io.readInt();
            b[l] += c;
            b[r + 1] -= c;
        }
        for(int i = 1; i <= n; i++) {
            b[i] += b[i-1];
            io.out.print(b[i]);
            if(i != n) io.out.print(" ");
        }
        io.out.flush();

    }
}
